package cn.gs;

import cn.gs.common.utils.PasswordHelper;
import cn.gs.system.entity.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author gs
 * @date 2020/1/10
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class PasswordEncrpt {

    @Autowired
    private PasswordHelper passwordHelper;

    // 获取加密后的密码
    @Test
    public void test(){
        User user = new User();
        user.setUsername("gs");
        user.setPassword("123456");
        passwordHelper.encryptPassword(user);
        System.out.println(user);
    }
}
